from django.http import HttpResponse
from django.shortcuts import render
from .models import Wechat
# Create your views here.
def hello(request):
    return HttpResponse("Hello World!")

def wechat_list(request):
    # 取出所有博客文章
    wechats = Wechat.objects.all()
    # 需要传递给模板（templates）的对象
    context = { 'wechats': wechats }
    # render函数：载入模板，并返回context对象
    return render(request, 'wechat/list.html', context)